//Accepted
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <iostream>
#include <list>
#include <deque>
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;


int main (){
	//freopen("in.txt", "r", stdin);//freopen("out.txt", "w", stdout);
	char a[3][4], i, j, ok=1;
	for(i=0;i<3;++i)scanf("%s", a[i]);
	
	for(i=0;i<2;++i)
	for(j=0;j<3;++j)
	if(a[i][j]!=a[2-i][2-j])ok=0;
	
	if(ok)printf("YES");
	else  printf("NO");
	return 0;
}
